package com.lvmama.comm.sync.pojo;

import java.io.Serializable;

/**
 * 模板脚本.
 * @author zuoxiaoshuai
 */
public class SyncTemplateSql implements Serializable {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -2111294568991061231L;

	/** 主键. */
	private Long templateSqlId;
	
	/** 模板ID. */
	private Long templateId;
	
	/**
	 *  触发类型.
	 *  @see com.lvmama.comm.vo.Constant.TRIGGER_TYPE
	 */
	private String triggerType;
	
	/** 脚本类型. */
	private String sqlType;
	
	/** 排序. */
	private Integer sort;
	
	/** 描述. */
	private String description;
	
	/** 脚本内容. */
	private String sqlContent;
	
	/**
	 * 脚本类型
	 * @see com.lvmama.comm.vo.Constant.SYNC_SCRIPT_TYPE
	 */
	private String scriptType;
	
	/** Target SQL对应的 Source SQL的主键(TEMPLATE_SQL_ID). */
	private String sourceSqlId;
	
	/** 数据源ID. */
	private String dataSourceId;
	
	private String match;

	/**
	 * Gets the template sql id.
	 *
	 * @return the template sql id
	 */
	public Long getTemplateSqlId() {
		return templateSqlId;
	}

	/**
	 * Sets the template sql id.
	 *
	 * @param templateSqlId the new template sql id
	 */
	public void setTemplateSqlId(Long templateSqlId) {
		this.templateSqlId = templateSqlId;
	}

	/**
	 * Gets the template id.
	 *
	 * @return the template id
	 */
	public Long getTemplateId() {
		return templateId;
	}

	/**
	 * Sets the template id.
	 *
	 * @param templateId the new template id
	 */
	public void setTemplateId(Long templateId) {
		this.templateId = templateId;
	}

	/**
	 * Gets the trigger type.
	 *
	 * @return the trigger type
	 */
	public String getTriggerType() {
		return triggerType;
	}

	/**
	 * Sets the trigger type.
	 *
	 * @param triggerType the new trigger type
	 */
	public void setTriggerType(String triggerType) {
		this.triggerType = triggerType;
	}

	/**
	 * Gets the sql type.
	 *
	 * @return the sql type
	 */
	public String getSqlType() {
		return sqlType;
	}

	/**
	 * Sets the sql type.
	 *
	 * @param sqlType the new sql type
	 */
	public void setSqlType(String sqlType) {
		this.sqlType = sqlType;
	}

	/**
	 * Gets the sort.
	 *
	 * @return the sort
	 */
	public Integer getSort() {
		return sort;
	}

	/**
	 * Sets the sort.
	 *
	 * @param sort the new sort
	 */
	public void setSort(Integer sort) {
		this.sort = sort;
	}

	/**
	 * Gets the description.
	 *
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Sets the description.
	 *
	 * @param description the new description
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * Gets the sql content.
	 *
	 * @return the sql content
	 */
	public String getSqlContent() {
		return sqlContent;
	}

	/**
	 * Sets the sql content.
	 *
	 * @param sqlContent the new sql content
	 */
	public void setSqlContent(String sqlContent) {
		this.sqlContent = sqlContent;
	}

	/**
	 * Gets the source sql id.
	 *
	 * @return the source sql id
	 */
	public String getSourceSqlId() {
		return sourceSqlId;
	}

	/**
	 * Sets the source sql id.
	 *
	 * @param sourceSqlId the new source sql id
	 */
	public void setSourceSqlId(String sourceSqlId) {
		this.sourceSqlId = sourceSqlId;
	}

	/**
	 * Gets the data source id.
	 *
	 * @return the data source id
	 */
	public String getDataSourceId() {
		return dataSourceId;
	}

	/**
	 * Sets the data source id.
	 *
	 * @param dataSourceId the new data source id
	 */
	public void setDataSourceId(String dataSourceId) {
		this.dataSourceId = dataSourceId;
	}

	public String getScriptType() {
		return scriptType;
	}

	public void setScriptType(String scriptType) {
		this.scriptType = scriptType;
	}

	public String getDesc() {
		final int step = 30;
		StringBuilder buffer = new StringBuilder(this.getDescription());
		int curPos = 0;
		while (buffer.length() - curPos > step) {
			curPos += step;
			buffer.insert(curPos, "\n");
		}
		return buffer.toString();
	}

	public String getMatch() {
		return match;
	}

	public void setMatch(String match) {
		this.match = match;
	}
	
	
}
